home *** CD-ROM | disk | FTP | other *** search
- on(release){
- if(_root.player.cash - cost >= 0 && (upgrade_type != "PUPGRADE" || upgrade_type == "PUPGRADE" && !_root.car["UPGRADE" add scrollnum]))
- {
- _root.player.cash -= cost;
- if(upgrade_type != "PUPGRADE")
- {
- property = _root.car[_root[upgrade_type].UPGRADESET1[scrollnum]];
- property += _root[upgrade_type].UPGRADESET[scrollnum];
- }
- else
- {
- _root.car.HP += _root[upgrade_type].UPGRADESET[scrollnum];
- _root.car.TQ += _root[upgrade_type].UPGRADESET[scrollnum];
- _root.car.WT += 100;
- _root.car["UPGRADE" add scrollnum] = true;
- if(_root.car.HP > 999)
- {
- _root.car.HP = 999;
- }
- if(_root.car.TQ > 700)
- {
- _root.car.TQ = 700;
- }
- }
- if(property > _root[_root[upgrade_type].UPGRADESET1[scrollnum] + "MAX"])
- {
- property = _root[_root[upgrade_type].UPGRADESET1[scrollnum] + "MAX"];
- _root.player.cash += cost;
- }
- else if(upgrade_type == "WEIGHT" && property < 1000)
- {
- _root.player.cash += cost;
- property = 1000;
- }
- if(upgrade_type != "PUPGRADE")
- {
- _root.car[_root[upgrade_type].UPGRADESET1[scrollnum]] = Math.round(property * 10) / 10;
- }
- Update();
- }
- else
- {
- _root.prompt(" ","Not Enough Cash!",3);
- }
- }
-